<%@page import="tournoi.modele.Arbitre"%>
<%@page import="tournoi.modele.Rencontre.InfoSupplementaire"%>
<%@page import="tournoi.modele.Rencontre"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"
	import="java.util.ArrayList, java.util.List" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html class="no-js">
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>Arbitre match</title>
	<meta name="description" content="">
	<meta name="viewport" content="width=device-width">
	
	<link rel="stylesheet" href="css/bootstrap.min.css">
	<style>
	body {
		padding-top: 50px;
		padding-bottom: 20px;
	}
	</style>
	<link rel="stylesheet" href="css/bootstrap-theme.min.css">
	<link rel="stylesheet" href="css/main.css">
	
	<script src="js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
</head>
<body>
	<div class="navbar navbar-inverse navbar-fixed-top">
		<div class="container">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle" data-toggle="collapse"
					data-target=".navbar-collapse">
					<span class="icon-bar"></span> <span class="icon-bar"></span> <span
						class="icon-bar"></span>
				</button>
				<a class="navbar-brand" href="index">Gestion de
					Tournoi</a>
			</div>
			<div class="navbar-collapse collapse">
				<ul class="nav navbar-nav">
		            <li><a href="admin">Admin menu</a></li>
		            <li class="active"><a href="admin?action=menuTournoi">Gérer tournois</a></li>
		            <li><a href="admin?action=menuEquipe">Gérer equipes</a></li>
		            <li><a href="admin?action=menuArbitre">Gérer arbitres</a></li>
				</ul>

				<div class="nav navbar-nav navbar-right navbar-form">
					<a href="admin?action=deconnexion" class="btn btn-danger">
						Déconnexion <span class="glyphicon glyphicon-log-out"></span>
					</a>
				</div>
			</div>
			<!--/.navbar-collapse -->
		</div>
	</div>
	<!-- ******************** -->
	<!-- ******************** -->
	<!-- CODE INTERESSANT ICI -->
	<!-- ******************** -->
	<!-- ******************** -->
	<div class="container">
		<%
			Rencontre r = (Rencontre) request.getAttribute("match");
		%>
		<h3 style="text-align: center;">
			Rencontre :
			<%=r.getEquipeUne().getNomEquipe()%>
			vs
			<%=r.getEquipeDeux().getNomEquipe()%></h3>
		<hr>
		<%
			//Message en cas d'action
			String alert = (String) request.getAttribute("etat");
			out.write(alert);
		%>
		<form class="form-horizontal" role="form" action="admin?action=ajouterArbitre&match=<%=r.getIdRencontre()%>" method="post">
		  <div class="form-group">
		    <label for="arbitre" class="col-sm-2 control-label">Arbitre</label>
		    <div class="col-sm-10">
		    	<select id="arbitre" name="arbitre" class="selectpicker">
					<% List<Arbitre> lesArbitres = (ArrayList<Arbitre>) request.getAttribute("arbitres");
						for(Arbitre a : lesArbitres) {
					%>
					<option value="<%=a.getId()%>"><%=a.getNom()%></option>
					<%
						}
					%>
				</select>
		    </div>
		  </div>
		  <div class="form-group">
		    <div class="col-sm-offset-2 col-sm-10">
		      <button type="submit" class="btn btn-default">Assigner</button>
		    </div>
		  </div>
		</form>

		
	<hr>
	<a href="admin?action=voirTournoi&id=<%=r.getTournoi()%>"
		class="btn btn-default" role="button"> <span
		class="glyphicon glyphicon-chevron-left"></span> Retour
	</a>
	
	<!-- ************************ -->
	<!-- ************************ -->
	<!-- FIN CODE INTERESSANT ICI -->
	<!-- ************************ -->
	<!-- ************************ -->
	<hr>
	<footer>
		<p class="text-muted credit">&copy; Benoît Boyer, Antoine Leguy &
			Pierre-Antoine Milot 2013</p>
	</footer>
	</div>
	<!-- /container -->
	<script
		src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
	<script>
		window.jQuery
				|| document
						.write('<script src="js/vendor/jquery-1.10.1.min.js"><\/script>')
	</script>

	<script src="js/vendor/bootstrap.min.js"></script>

	<script src="js/main.js"></script>
</body>
</html>
